package ca.seia.comp6521.a2.hashstorage;

public class HashBitVector {

	
	private boolean[] bitVector;
	private HashStrategy hashStrategy;
	
	public HashBitVector(boolean[] bitVector, HashStrategy hashStrategy) {
		this.bitVector = bitVector;
		this.hashStrategy = hashStrategy;
	}

	public boolean isBucketFrequent(int item1, int item2) {
		return bitVector[getBucketIndex(item1, item2)];
	}
	
	public int getBucketIndex(int item1, int item2) {
		return hashStrategy.getHashBucket(item1,item2) % bitVector.length;
	}

	public boolean[] getBitVector() {
		return bitVector;
	}

	public void setBitVector(boolean[] bitVector) {
		this.bitVector = bitVector;
	}

	public HashStrategy getHashStrategy() {
		return hashStrategy;
	}

	public void setHashStrategy(HashStrategy hashStrategy) {
		this.hashStrategy = hashStrategy;
	}
	
	
}
